Skip to content

Fix intl tests failed because of missing skipif section - #162

Merged
php-pulls merged 1 commit into
php:masterfrom
reeze:fix-intl-tests
Aug 15, 2012
Merged

php-pulls merged 1 commit into
php:masterfrom
reeze:fix-intl-tests

Conversation

@reeze

@reeze reeze commented Aug 14, 2012

Copy link
Copy Markdown
Contributor

Many intl test cases missing skipif section to detect if extension available. and some of them miss a '<?php' see: https://github.com/reeze/php-src/pull/new/php:master...reeze:fix-intl-tests#diff-0

Those test cases are in master only :)

Thanks

@travisbot

Copy link
Copy Markdown

This pull request fails (merged 80044a0 into cd4e5d2).

@php-pulls
php-pulls merged commit 80044a0 into php:master Aug 15, 2012
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 12, 2026
Problem

Jordan ruled that nothing nests: every type, events and interfaces
included, is declared at file level in a namespace, in its own file.
The section 15 note still named a nested event `App\Order\Paid`,
autoloaded it through its outer class, resolved a bare name to the
nested type first, read a dotted type and `new X.Y`, and asked Jordan
three questions he has since answered.

Solution

The note opens with the ruling and names every PR whose scope shrinks
or changes: mago-sharp PR 1 (#162) and PR 3, php-sharp PR A and the
spec-files PR. Decisions 1 (nested-type naming) and 6 (autoload
through the outer class) go, and the rest take new numbers. Language
rule 6 is now the nested-type refusal, and rule 7 goes. The questions
become Jordan's rulings, `extern event … uses` gives the class its
effects, and `Effect::Emit` carries no payload. Every example names
`OrderPaid` and `OrderEvent`, and the states #162 now shows, on the
checker and on the engine, are quoted from a run.

docs/architecture/slices/
└── 15-events.md    the ruling, the PRs it reshapes, and file-level names throughout
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 12, 2026
…uctors, events and init

Mago #152 merged Mago master's named constructors (#161), events (#162) and
the `init` accessor (#169), so this branch pinned a Mago without them, and
the spec examples that use them still failed here.

The engine now builds from Mago 1b517f4. The generated header changes only
in the commit it names. Six more spec examples pass and leave the baseline,
written with the `cp` command `sharp/bin/test --spec` prints:
- §9.1 constructor-call-this, named-constructors and set-once
- §15 extern-event, extern-event-effects and standalone-event

ext/sharp/sharp_unit.h   <- names Mago 1b517f4
sharp/baseline/spec      <- the six examples that now pass leave it
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

PR 2 stacks on #162, and #162's review round 1 changed the event tests that
PR 2 rewords: the interface property test and the event write test.

Solution

Each test keeps PR 2's wording for a missing interface property and for a
write to an event's property, and #162's new rows for a property of the wrong
type, access or `static`, and for a write through the interface.

crates/
└── analyzer/tests/sharp.rs   PR 2's wording and #162's rows, together
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

PR 2 stacks on #162, and #162's review round 1 changed the event tests that
PR 2 rewords: the interface property test and the event write test.

Solution

Each test keeps PR 2's wording for a missing interface property and for a
write to an event's property, and #162's new rows for a property of the wrong
type, access or `static`, and for a write through the interface.

crates/
└── analyzer/tests/sharp.rs   PR 2's wording and #162's rows, together
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

Jordan ruled that nothing nests: every type, events and interfaces
included, is declared at file level in a namespace, in its own file.
#162 still nested an event or an interface in a class, named it
`Order.Paid`, resolved a bare name to the nested type first, read
`new Order.Paid(…)` and a dotted type, and lowered the nested type
as `Order\Paid`. A `.` in code is always member access, spec section
23, so a dotted type is not PHP#. `extern event … uses …` was refused
as not supported yet, and Jordan allowed it.

Solution

A type declared inside a class, an interface, an enum, a trait or a
module is one parse error over the whole type, which names its owner:
"A class can't declare a type inside it: declare `Paid` in its own
file." The owner parses on without it. Every part of nesting goes:
the CST members, the nested-first and dotted name resolution, the
dotted `new` and its analyzer resolution, the nested naming in
messages, the nested lowering and the nested-type checks. A named
constructor parses as on master again. An `extern event` with `uses`
gives the plain PHP class its effects, as an `extern` of the class
does.

crates/
├── syntax/src/
│   ├── error.rs                         NestedTypeInSharp, with its owner
│   ├── parser/mod.rs                    State.members_of names the owner
│   ├── parser/internal/class_like/
│   │   ├── method.rs                    parse_nested_type refuses it; named constructor as on master
│   │   ├── mod.rs                       each class-like names itself before a member
│   │   ├── inheritance.rs               as on master
│   │   └── …
│   ├── parser/internal/module.rs        a module names itself before a member
│   ├── parser/internal/expression.rs    as on master
│   ├── parser/internal/identifier.rs    as on master
│   ├── parser/internal/type_hint.rs     as on master
│   ├── cst/cst/class_like/member.rs     no Event or Interface member
│   ├── cst/node.rs, walker/mod.rs       no nested arms
│   └── cst/cst/event.rs                 an event is declared at file level
├── names/src/internal/walker.rs         no nested-first or dotted resolution
├── codex/src/scanner/mod.rs             no constructor save around a nested type
├── analyzer/src/
│   ├── expression/instantiation.rs      no dotted `new` resolution
│   ├── statement/class_like/mod.rs      no nested types after their class
│   ├── statement/function_like/mod.rs   no "has no event" wording
│   └── utils/names.rs                   no nested naming
├── semantics/src/internal/checker/
│   ├── sharp.rs                         no nested checks; `extern event … uses` allowed
│   └── class_like/mod.rs                no nested arms
├── sharp-bridge/src/lower.rs            no nested lowering
├── hir/, fingerprint/, formatter/       no nested arms
└── */tests                              file-level rows; the nested and dotted rows go
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

Master fingerprints a class-like's header, leaves impossible
unreachable! lines out of patch-coverage, and compiles a project with a
law twice. #162 lacks all three.

Solution

Merge master. An event fingerprints its header through master's
`Inheritance` fingerprint.

crates/
└── fingerprint/src/class_like/mod.rs    Event reads its header as Class does
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

#162 now declares every type at file level, as Jordan ruled: a type
declared inside another is one parse error, and a dotted type or
`new X.Y` resolution is gone. PR 2's `emit` tests and examples raised
a nested `Order.Paid` and named `Order.Event`, so they parsed as
errors on the new #162.

Solution

Every `emit` example and test raises the file-level `OrderPaid` and
names `OrderEvent`, from #162's `ORDER_EVENTS` files. The bridge test
declares `OrderPaid` in its own library file. `emit_takes_an_event`
declares `Money` in its own file and drops its standalone `Shipped`,
which only stood beside a nested event. The syntax tests for a dotted
type and a nested interface, and the analyzer test for dotted names,
go with #162.

crates/
├── analyzer/tests/sharp.rs           emit and event tests name OrderPaid and OrderEvent
├── semantics/tests/
│   ├── fixtures/slice.sharp          Order.settle emits a file-level OrderPaid
│   └── sharp.rs                      emit in a file raises OrderPaid
├── sharp-bridge/tests/lower.rs       emit lowers `new \App\OrderPaid`, declared beside it
└── syntax/
    ├── src/cst/cst/emit.rs           doc example emits OrderPaid
    ├── src/parser/internal/emit.rs   doc example emits OrderPaid
    └── tests/sharp.rs                emit test parses `emit new OrderPaid(1);`
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

#162 now checks the property a class inherits against the interface
it names, from review round 2. PR 2 stacks on #162, and both edited the
doc comment of `an_event_or_a_class_gives_every_property_its_interfaces_state`.

Solution

The doc comment keeps PR 2's sentence on how an event and a class give
a property, and adds #162's sentence on inherited properties.

crates/analyzer/
└── tests/sharp.rs    one doc comment holds both rules
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
feat: declare events at file level, mark plain PHP events with extern event
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem

#162 merged into master as 087ac0e, beside #167's Lean changes. PR 2
stacked on #162, so it must open against master with master merged.

Solution

Merge master. It brings #167, which PR 2's files do not touch, and
#162, which PR 2 already holds. No file conflicted.

crates/sharp-lean/    from #167
tests/compile.rs      from #167
Cargo.toml, Cargo.lock
heyJordanParker referenced this pull request in heyJordanParker/php-sharp Oct 13, 2026
Problem: master merged #161, named constructors, and #162, events and the
interface's get-only property, after d3adf51, the last master this branch
merged. Both change `new`, the class member parser, the checker's walk, the
analyzer's `return` and lambda lowering, which the generics slice changes too,
so 15 files conflicted and the PR could not merge.

Solution: merge 7236cd0 with no rebase, keeping both sides' behavior in
every conflict, then fix four places where one side stopped the other's
behavior from taking effect:

Keep both sides of each conflict:
- `new` carries both the type arguments and the named constructor, so
  `new PaginatedList<Order>(rows)` and `new Artifact.fromJson(json)` both lower
- the `return` check takes master's named constructor return type and this
  branch's `expect_type` and generic `static` type
- a lambda keeps this branch's lowering, which also captures its method's
  type arguments; master's `Node` argument to `closure_uses` read only a span
- the checker's notes name type parameters and named constructors together

Write `Class<Order>` as a member's type again:
- master's nested-type refusal took any member that starts with `class` for a
  nested class; `class` followed by `<` is now the type `Class<…>`, since a
  declared class names itself first

Refuse a named constructor in a generic class with a true message:
- a named constructor runs as a static method, which a generic class's type
  arguments reach only in R4, so a generic class declared one with the false
  error "`Box` needs its type argument"; it is now "not supported yet", and a
  call of one adds no type argument error the user has no place to write

Check a generic interface's property against the header's type argument:
- master's check compared a class's property with the interface's raw type
  parameter, so `string item` under `: Holder<int>` compiled; the stated type
  now reads `TItem` as the header's `int`

Keep an event's header type arguments for the engine:
- an event's header, as in `: Holder<int>`, now lowers its type text list as
  a class's does, so the engine knows the event is a `Holder<int>`

crates/
├── analyzer/
│   ├── src/expression/instantiation.rs        <- `new` takes type arguments and a named constructor
│   ├── src/statement/class_like/mod.rs        <- both signature checks, the localized interface property type
│   ├── src/statement/return.rs                <- named constructor return type with expect_type
│   └── tests/sharp.rs                         <- both sides' tests, the named constructor call and generic interface property tests
├── codex/src/scanner/
│   ├── class_like.rs                          <- an event declares no type parameters
│   └── function_like.rs                       <- an event's parameters read an empty type context
├── names/
│   ├── src/binding.rs                         <- a named constructor declares no type parameters
│   └── src/internal/walker.rs                 <- the event walk beside the method type parameters
├── semantics/
│   ├── src/internal/checker/sharp.rs          <- both sides' places and notes, the generic class named constructor refusal
│   └── tests/sharp.rs                         <- the arity test, the merged notes, the refusal test
├── sharp-bridge/
│   ├── src/lower.rs                           <- named constructor and generic `new`, lambdas, the event's header type arguments
│   └── tests/lower.rs                         <- both sides' tests, the event header test
└── syntax/
    ├── src/cst/cst/instantiation.rs           <- `new` holds both fields
    ├── src/cst/node.rs, src/walker/mod.rs     <- both fields are walked
    ├── src/parser/internal/class_like/method.rs  <- `class<` is the type `Class<…>`
    ├── src/parser/internal/expression.rs      <- a named constructor call has no type arguments
    ├── src/parser/internal/instantiation.rs   <- `new` parses type arguments, no named constructor
    ├── src/parser/internal/statement.rs       <- the event statement beside a `Class<…>` local
    └── tests/sharp.rs                         <- named constructors leave the not-supported rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants